package com.ptu.server;

import com.ptu.dto.UserDTO;
import com.ptu.dto.UserLoginDTO;
import com.ptu.entity.User;
import com.ptu.util.PageResult;
import com.ptu.util.Result;
import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Service;


@Service
public interface UserServer {

    /**
     * 注册
     * @param userDTO
     */
    void register(UserDTO userDTO);

    Result sendCode(String phone, HttpSession session);

    Result login(UserLoginDTO loginForm, HttpSession session);

    void update(UserDTO userDTO);

    void saveAvatar(Integer id, String img);


    UserDTO getUser();


    PageResult getUserList(String phone, String userName,Integer pageNum, Integer pageSize);


    User adminGetUser(Integer id);


    void adminUpdate(UserDTO user);

    void delete(Integer id);

    void adminAdd(UserDTO user);

    Result adminLogin(String adminName, String password);
}
